package org.gpp.proj1.util;

import org.gpp.proj1.util.test.JMETestCase;

public class TextureStateFactoryTest extends JMETestCase {

	/*
	 * Test method for 'org.gpp.proj1.util.TextureStateFactory.getTextureState(int)'
	 */
	public void testGetTextureStateInt() {
		try {
			TextureStateFactory.getInstance().getTextureState( -1 );
			fail();
		} catch ( AssertionError e ) {
			// expected error
		}
		
		try {
			TextureStateFactory.getInstance().getTextureState( 0 );			
		} catch ( AssertionError e ) {
			fail();
		}
		
		assertNull( TextureStateFactory.getInstance().getTextureState( Integer.MAX_VALUE ) );
		assertNotNull( TextureStateFactory.getInstance().getTextureState( 0 ) );
	}

	/*
	 * Test method for 'org.gpp.proj1.util.TextureStateFactory.getTextureState(String)'
	 */
	public void testGetTextureStateString() {
		try {
			TextureStateFactory.getInstance().getTextureState( "IDONOTEXIST.png" );
			fail();
		} catch ( AssertionError e ) {
			// expected error
		}
		
		try {
			TextureStateFactory.getInstance().getTextureState( null );
			fail();
		} catch ( AssertionError e ) {
			// expected error
		}
		
		try {
			TextureStateFactory.getInstance().getTextureState( "test/textures/test.png" );			
		} catch ( AssertionError e ) {
			fail();
		}

		assertNotNull( TextureStateFactory.getInstance().getTextureState( "test/textures/test.png" ) );
	}

}
